import {createRouter,createWebHistory} from 'vue-router'

import LoginVue from '@/views/Login.vue'
import LayoutVue from '@/views/Layout.vue'
import ArticleCategoryVue from '@/views/article/ArticleCategory.vue'
import ArticleManageVue from '@/views/article/ArticleManage.vue'
import UserAvatarVue from '@/views/user/UserAvatar.vue'
import UserInfoVue from '@/views/user/UserInfo.vue'
import UserResetPasswordVue from '@/views/user/UserResetPassword.vue'
import clientmanageVue from  '@/views/client/clientManege.vue'
import AdPositionInfo from '@/views/adposition/AdPositionInfo.vue'
import statistics from '@/views/statistics/statistics.vue'
//定义路由关系
const routes = [
    {path:'/login',component:LoginVue},
    {path:'/',
        component:LayoutVue,
        redirect:'/article/manage',
        children:[
        {path:'/statistics',component:statistics},
        {path:'/article/category',component:ArticleCategoryVue},
        {path:'/article/manage',component:ArticleManageVue},
        {path:'/client/manage',component:clientmanageVue},
        {path:'/adposition/manage',component:AdPositionInfo},
        {path:'/user/updateAvatar',component:UserAvatarVue},
        {path:'/user/userInfo',component:UserInfoVue},
        {path:'/user/updatePwd',component:UserResetPasswordVue}
    ]}
]

//创建路由器
const router = createRouter({
    history:createWebHistory(),
    routes:routes
})

//导出路由
export default router
